<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<title>个案信息查询管理</title>
<meta name="decorator" content="default"/>
<script src="${ctxStatic}/common/change/change.js"></script>
<script type="text/javascript">
$(document).ready(function() {
	initVaccName(childVaccRecord.companyCode,childVaccRecord.vaccineId);
	initVaccCompanyName(childVaccRecord.companyCode);
	$(".vaccineCompany").change(function(){
		var vaccId = $(this).val();
		initCompanyName($(this).val());
		if(vaccId == ""){
			initVaccCompanyName("");
		}
	});
	$(document).on("click","#check",function(){
		var url = "${ctx}/child/childBaseinfo/findByChildId?childId="
			+$(this).parent().parent().attr("data-id")
    	parent.layer.open({
			type : 2,
			title : '儿童个案接种信息',
			shadeClose : true,
			shade : 0.8,
			maxmin: true,
			area : [screen.availWidth * 0.7 + 'px', screen.availHeight * 0.6 + 'px' ],
			content : url
		});
    });
});
var childBaseinfo = JSON.parse('${fns:toJson(childBaseinfo)}');
var childVaccRecord = JSON.parse('${fns:toJson(childBaseinfo.childVaccRecord)}');
function page(n,s){
	$("#pageNo").val(n);
	$("#pageSize").val(s);
	$("#searchForm").submit();
    return false;
}
function down(){
	top.$.jBox.confirm("确认要导出儿童个案信息数据吗？","系统提示",function(v,h,f){
		if(v=="ok"){
			var url ="${ctx}/child/childBaseinfo/VaccChildInfoExport"
			$("#searchForm").attr("action",url);
			$("#searchForm").submit();
		}
		$("#searchForm").attr("action","${ctx}/child/childBaseinfo/findByVaccChildInfo");
	},{buttonsFocus:1});
	top.$('.jbox-body .jbox-icon').css('top','55px');
}
</script>
<style type="text/css">
.minWidth {
	min-width: 177px;
}	
#contentTable td ,#contentTable th{
	text-align: center;
}
#contentTable {
    padding:2px 10px;
    width: 99%;
}
#contentTable tbody tr td{
	font-size: 13px;
}
</style>
</head>
<body>
	<form:form id="searchForm" modelAttribute="childBaseinfo" action="${ctx}/child/childBaseinfo/findByVaccChildInfo" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<input id="childVaccRecord.vaccineId" name="childVaccRecord.vaccineId" type="hidden" value="${childBaseinfo.childVaccRecord.vaccineId}"/>
		<input id="childVaccRecord.companyCode" name="childVaccRecord.companyCode" type="hidden" value="${childBaseinfo.childVaccRecord.companyCode}"/>
		<input id="childVaccRecord.batch" name="childVaccRecord.batch" type="hidden" value="${childBaseinfo.childVaccRecord.batch}"/>
		<input id="childVaccRecord.batchno" name="childVaccRecord.batchno" type="hidden" value="${fn:join(childBaseinfo.childVaccRecord.batchno,',')}"/>
		<input id="childVaccRecord.storeCode" name="childVaccRecord.storeCode" type="hidden" value="${childBaseinfo.childVaccRecord.storeCode}"/>
		<input id="childVaccRecord.beginTime" name="childVaccRecord.beginTime" type="hidden" value="<fmt:formatDate value="${childBaseinfo.childVaccRecord.beginTime}" pattern="yyyy-MM-dd hh:mm:ss"/>"/>
		<input id="childVaccRecord.endTime" name="childVaccRecord.endTime" type="hidden" value="<fmt:formatDate value="${childBaseinfo.childVaccRecord.endTime}" pattern="yyyy-MM-dd hh:mm:ss"/>"/>	
		<table class="table table-bordered">
			<tr>
				<th>疫苗名称:</th>
				<td>
					<form:select path="childVaccRecord.vaccineId" id="vaccineId" class="span3 minWidth vaccineCompany" disabled="true">
						<form:option value="" label="--请选择--"/>
					</form:select>
				</td>
				<th>生产企业：</th>
				<td>
					<form:select path="childVaccRecord.companyCode" id="companyCode" class="span2 minWidth changeCompany vaccCompanyName" disabled="true">
					    <form:option value="" label="--请选择--"/> 
					</form:select>
				</td>
				<th>批号：</th>
				<td>
				    <form:input path="childVaccRecord.batch" id="batch" class="span2 minWidth" disabled="true"/>
				</td>
			</tr>
			<tr>
			    <th>接种起始日期</th>
				<td>
					<input name="childVaccRecord.beginTime" id ="beginTime" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate" disabled="disabled"
						value="<fmt:formatDate value="${childBaseinfo.childVaccRecord.beginTime}" pattern="yyyy-MM-dd"/>"
						onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
				</td>
				<th>接种截止日期</th>
				<td>
					<input name="childVaccRecord.endTime" id ="endTime" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate" disabled="disabled"
						value="<fmt:formatDate value="${childBaseinfo.childVaccRecord.endTime}" pattern="yyyy-MM-dd"/>" 
						onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
				</td>
			    <th>接种单位：</th>
				<td>
					<form:input path="childVaccRecord.departname" id="departname" class="span2 minWidth" disabled="true"/>
				</td>
			</tr>
		</table>
		<input onclick="down()" class="btn btn-primary" type="button" value="导出"/>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>儿童编码</th>
				<th>姓名</th>
				<th>性别 </th>
				<th>出生日期</th>
				<th>母亲</th>
				<th>母亲身份证号</th>
				<th>母亲手机号</th>
				<th>父亲</th>
				<th>父亲身份证号</th>
				<th>父亲手机号</th>
				<th>现住址</th>
				<th>居住</th>
				<th>在册情况</th>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="childBaseinfo">
			<tr data-id="${childBaseinfo.id}">
				<td style="width: 50px;"> 
				    <a href="javascript:;" id ="check">${childBaseinfo.childcode}</a>
				</td>
				<td style="width: 50px;">
					${childBaseinfo.childname}
				</td>
				<td>
					${fns:getDictLabel(childBaseinfo.gender, "sex", "")}
				</td>
				<td>
					<fmt:formatDate value="${childBaseinfo.birthday}" pattern="yyyy/MM/dd"/>
				</td>
				<td>
					${childBaseinfo.guardianname}
				</td>
				<td style="width: 50px;">
					${childBaseinfo.guardianidentificationnumber}
				</td>
				<td>
					${childBaseinfo.guardianmobile}
				</td>
				<td>
					${childBaseinfo.father}
				</td>
				<td style="width: 50px;">
					${childBaseinfo.fathercard}
				</td>
				<td>
					${childBaseinfo.fatherphone}
				</td>
				<td>
					${childBaseinfo.address}
				</td>
				
				<td>
					${fns:getDictLabel(childBaseinfo.reside, "reside", "")}
				</td>
				<td>
					${fns:getDictLabel(childBaseinfo.situation, "child_situation", "")}
				</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>